package com.ants.boot.wx.controller;

import com.ants.boot.core.Response;
import com.ants.boot.wx.domain.WxAreaCode;
import com.ants.boot.wx.service.WxAreaCodeService;
import com.ants.boot.wx.vo.wxareacode.ListAreaCodeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 蚂蚁会花呗
 * @date 2022/6/2 10:21
 */
@RestController
@RequestMapping("wx/area_code")
@Api(tags = "地区编码")
public class WxAreaCodeController {

    @Autowired
    private WxAreaCodeService wxAreaCodeService;


    @GetMapping("list_area_code")
    @ApiOperation(value = "地区编码列表",tags = "地区编码列表")
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功！",response = ListAreaCodeVo.class)
    })
    public Response listAreaCode(){
        return Response.okData(wxAreaCodeService.listAreaCode());
    }


    @GetMapping("tree_area_code")
    @ApiOperation(value = "地区编码树形列表",tags = "地区编码树形列表")
    @ApiResponses({
            @ApiResponse(code = 200,message = "请求成功！",response = WxAreaCode.class)
    })
    public Response treeAreaCode(){
        return Response.okData(wxAreaCodeService.treeAreaCode());
    }

}
